package com.java2007.hotel.entity;

import java.util.List;

/**
 * @author Reckeys
 * @version V1.0
 * @date 2021/01/13
 **/
public class PageBean<T>{
    /**
     * 总条数
     */
    private Long totalCount;

    /**
     * 总页数
     */
    private Long totalPage;

    /**
     * 当前页数
     */
    private Integer pageNo;

    /**
     * 一页显示的信息数
     */
    private Integer pageSize;

    /**
     * 一页显示的信息
     */
    private List<T> pageList;

    public PageBean() {
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public List<T> getPageList() {
        return pageList;
    }

    public void setPageList(List<T> pageList) {
        this.pageList = pageList;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage() {
        this.totalPage = this.totalCount % this.pageSize ==0 ? this.totalCount/this.pageSize:this.totalCount/this.pageSize + 1;
    }

    public void setTotalPage(Long totalPage) {
        this.totalPage = totalPage;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
